﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GroupCheer.FBGraphAPI.API
{
    public class SearchWallPostController : SearchPaging<WallPost, WallPostCollection>
    {
        public new bool Load(string ContentKeyword)
        {
            return this.Load(ContentKeyword, 25);
        }

        public bool Load(string ContentKeyword, int SearchLimits)
        {
            string searchUrl = string.Format("https://graph.facebook.com/search?q={0}&type=post&access_token={1}&limit={2}",
                ContentKeyword, FBGraphAPIConfiguration.FBValidAccessToken, SearchLimits);
            return base.Load(searchUrl);
        }
    }

    public class SearchPageController : SearchPaging<Page, PageCollection>
    {
        public new bool Load(string ContentKeyword)
        {
            return this.Load(ContentKeyword, 25);
        }

        public bool Load(string ContentKeyword, int SearchLimits)
        {
            string searchUrl = string.Format("https://graph.facebook.com/search?q={0}&type=page&access_token={1}&limit={2}",
                ContentKeyword, FBGraphAPIConfiguration.FBValidAccessToken, SearchLimits);
            return base.Load(searchUrl);
        }
    }

    public class SearchEventController : SearchPaging<Event, EventCollection>
    {
        public new bool Load(string ContentKeyword)
        {
            return this.Load(ContentKeyword, 25);
        }

        public bool Load(string ContentKeyword, int SearchLimits)
        {
            string searchUrl = string.Format("https://graph.facebook.com/search?q={0}&type=event&access_token={1}&limit={2}",
                ContentKeyword, FBGraphAPIConfiguration.FBValidAccessToken, SearchLimits);
            return base.Load(searchUrl);
        }
    }

    public class SearchGroupController : SearchPaging<Group, GroupCollection>
    {
        public new bool Load(string ContentKeyword)
        {
            return this.Load(ContentKeyword, 25);
        }

        public bool Load(string ContentKeyword, int SearchLimits)
        {
            string searchUrl = string.Format("https://graph.facebook.com/search?q={0}&type=group&access_token={1}&limit={2}",
                ContentKeyword, FBGraphAPIConfiguration.FBValidAccessToken, SearchLimits);
            return base.Load(searchUrl);
        }
    }
}
